package com.axxc.jpa.vo;

import org.springframework.beans.BeanUtils;

import com.axxc.jpa.entity.HumanEntity;
import com.axxc.jpa.out.Developer;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @ClassName: PersonVO
 * @Description: Person视图对象
 * @author 熊小川
 * @date 2018年4月10日 下午10:12:23
 */

@ApiModel(value = "HumanVO",description="用户模型信息",parent=Developer.class)
public class HumanVO extends Developer {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "用户id", example = "null")
	private Long id;

	@ApiModelProperty(value = "用户名", example = "熊大")
	private String name;

	@ApiModelProperty(value = "用户年龄", example = "18")
	private Integer age;

	@ApiModelProperty(value = "用户性别,1=男,0=女", example = "1")
	private Byte sex;
	@ApiModelProperty(value = "分页参数页码,从1开始", example = "0")
	private Integer pageNum = 1;
	@ApiModelProperty(value = "分页参数每页条数", example = "10")

	private Integer pageSize = 10;

	public Integer getPageNum() {
		return pageNum;
	}

	public void setPageNum(Integer pageNum) {
		if (pageNum <= 0) {
			pageNum = 1;
		}
		this.pageNum = pageNum;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public Byte getSex() {
		return sex;
	}

	public void setSex(Byte sex) {
		this.sex = sex;
	}

	public HumanEntity toEntity() {
		HumanEntity target = new HumanEntity();
		BeanUtils.copyProperties(this, target);
		return target;
	}

}
